import { createSlice, configureStore } from "@reduxjs/toolkit"
import { Provider } from "react-redux"
import Name1 from "./demo1"
const counterSlice = createSlice({
  name: "counter",
  initialState: { value: 0 },
  reducers: {
    increment: (state) => {
      state.value += 1
    },
    decrement: (state) => {
      state.value -= 1
    },
  },
})

const { increment, decrement } = counterSlice.actions

const store = configureStore({
  reducer: counterSlice.reducer,
})
function Name(params: ang) {
  return (
    <div>
      Name // 使用store
      <Provider store={store}>
        <Name1 />
      </Provider>
    </div>
  )
}

// store.subscribe(() => console.log(store.getState()))

// store.dispatch(increment())
// store.dispatch(decrement())

export default Name
